﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" />

<xsl:template match="/">
	<VALUATION_RESPONSE>
		<VALUATION_METHODS>
			<SALES_COMPARISON>
				<xsl:for-each select="results/rows/row">
					<xsl:call-template name="property"></xsl:call-template>
				</xsl:for-each>
			</SALES_COMPARISON>
		</VALUATION_METHODS>
	</VALUATION_RESPONSE>
</xsl:template>

<xsl:template name="property">
	<xsl:variable name="count"><xsl:number/></xsl:variable>

	@&lt;@COMPARABLE_SALE PropertySequenceIdentifier=@&quot;@<xsl:value-of select='$count -1'/>@&quot;@ PropertySalesAmount=@&quot;@<xsl:value-of select='selling_price'/>@&quot;@ DataSourceDescription=@&quot;@MLS: <xsl:value-of select='ml_number'/> / DOM: <xsl:value-of select='dom'/> DAYS / LIST PRICE: <xsl:value-of select='listing_price'/>@&quot;@ DataSourceVerificationDescription=@&quot;@APN: <xsl:value-of select='apn'/> / APN_OTHER: <xsl:value-of select='apn_other'/>@&quot;@ ComparablePropertyComment=@&quot;@COMMENT: <xsl:value-of select='comments'/> <xsl:value-of select='comments_2'/> / FINANCE: <xsl:value-of select='financing_comments'/> / MARKETING: <xsl:value-of select='marketing_remarks'/> / ORIGINAL PRICE: <xsl:value-of select='original_price'/> / SELLING: <xsl:value-of select='selling_comments'/>@&quot;@@&gt;@
	@&lt;@LOCATION PropertyStreetAddress=@&quot;@<xsl:value-of select='street_number'/>@@<xsl:value-of select='street_direction'/>@@<xsl:value-of select='street_name'/>@@<xsl:value-of select='street_suffix'/>@@<xsl:value-of select='street_post_direction'/>@@<xsl:value-of select='unit_number'/>@&quot;@ PropertyStreetAddress2=@&quot;@<xsl:value-of select='city'/>,@@<xsl:value-of select='state'/>@@<xsl:value-of select='zip'/>@&quot;@ PropertyCity=@&quot;@<xsl:value-of select='city'/>@&quot;@ PropertyState=@&quot;@<xsl:value-of select='state'/>@&quot;@ PropertyPostalCode=@&quot;@<xsl:value-of select='zip'/>@&quot;@/@&gt;@
	@&lt;@ROOM_ADJUSTMENT TotalRoomCount=@&quot;@<xsl:value-of select='rooms'/>@&quot;@ TotalBedroomCount=@&quot;@<xsl:value-of select='bed_rooms'/>@&quot;@ TotalBathroomCount=@&quot;@<xsl:value-of select='bath_rooms'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@Age@&quot;@ _Description=@&quot;@AGE: <xsl:value-of select='age'/> / YEAR BUILT: <xsl:value-of select='year_built'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@BasementArea@&quot;@ _Description=@&quot;@<xsl:value-of select='basement'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@BasementFinish@&quot;@ _Description=@&quot;@<xsl:value-of select='basement_feat'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@CarStorage@&quot;@ _Description=@&quot;@<xsl:value-of select='garage'/> <xsl:value-of select='garage_desc'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@DateOfSale@&quot;@ _Description=@&quot;@PEND DATE: <xsl:value-of select='pending_date'/> / SELL DATE: <xsl:value-of select='selling_date'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@DesignStyle@&quot;@ _Description=@&quot;@<xsl:value-of select='style'/> / <xsl:value-of select='levels'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@GrossLivingArea@&quot;@ _Description=@&quot;@<xsl:value-of select='sqft_above_ground'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@HeatingCooling@&quot;@ _Description=@&quot;@<xsl:value-of select='heating'/>/<xsl:value-of select='cooling'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@Location@&quot;@ _Description=@&quot;@AREA: <xsl:value-of select='area'/> / SCHOOL DIST: <xsl:value-of select='school_district'/> / SUBDIVISION: <xsl:value-of select='sub_division'/> / SUBURB: <xsl:value-of select='suburb'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@Quality@&quot;@ _Description=@&quot;@<xsl:value-of select='exterior'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@SalesConcessions@&quot;@ _Description=@&quot;@<xsl:value-of select='financing'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@SiteArea@&quot;@ _Description=@&quot;@<xsl:value-of select='acres'/> ACRES / <xsl:value-of select='lot_sqft'/> SQ FT / LOT DIMS: <xsl:value-of select='lotd_computed'/>@&quot;@/@&gt;@
	@&lt;@SALE_PRICE_ADJUSTMENT _Type=@&quot;@View@&quot;@ _Description=@&quot;@<xsl:value-of select='view'/>@&quot;@/@&gt;@
	@&lt;@OTHER_FEATURE_ADJUSTMENT PropertyFeatureSequenceIdentifier=@&quot;@1@&quot;@ PropertyFeatureDescription=@&quot;@<xsl:value-of select='fireplaces'/> FIREPLACE@&quot;@/@&gt;@
	@&lt;@OTHER_FEATURE_ADJUSTMENT PropertyFeatureSequenceIdentifier=@&quot;@2@&quot;@ PropertyFeatureDescription=@&quot;@<xsl:value-of select='appliances'/>@&quot;@/@&gt;@
	@&lt;@OTHER_FEATURE_ADJUSTMENT PropertyFeatureSequenceIdentifier=@&quot;@3@&quot;@ PropertyFeatureDescription=@&quot;@<xsl:value-of select='outside_feature'/>@&quot;@/@&gt;@
	@&lt;@PRIOR_SALES PropertySalesDate=@&quot;@<xsl:value-of select='prior_sale_date'/>@&quot;@ PropertySalesAmount=@&quot;@<xsl:value-of select='prior_sale_amount'/>@&quot;@ DataSourceDescription=@&quot;@<xsl:value-of select='prior_sale_source'/>@&quot;@ DataSourceEffectiveDate=@&quot;@<xsl:value-of select='prior_sale_source_date'/>@&quot;@/@&gt;@
	<IMAGE><EMBEDDED_FILE><DOCUMENT>@<xsl:value-of select='ml_number'/>@</DOCUMENT></EMBEDDED_FILE></IMAGE>
	@&lt;@/COMPARABLE_SALE@&gt;@
</xsl:template>

</xsl:stylesheet>
